package jsj.myjdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class CreateTableDemo {

	public static void main(String[] args) {
		Connection conn = DBUtil.getConnection();
		try {
			Statement stmt = conn.createStatement();
			stmt.execute("create table student(sno varchar(5) primary key,name varchar(20),age integer(2),sex varchar(6))");
			stmt.execute("insert into student values('95001','guanyu',25,'male')");
			stmt.execute("insert into student values('95002','zhangfei',23,'male')");
			stmt.execute("insert into student values('95003','diaochan',19,'female')");
			stmt.execute("insert into student values('95004','xiaoqiao',18,'female')");
			System.out.println("数据表创建成功！");
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
